package test;


class Person
{
	 String name;
	 int age;
	 
	 public  void Style()
	 {
		 eat();
	 }
	 
	  void eat()
	 {
		 System.out.println("I am persn,I like eat fresh meat");
	 }
	 
}
class Student extends Person
{
	
	public void eat()
	 {
		 System.out.println("I am Student,I like eat fresh meat");
	 }
	
	public void study()
	{
		 super.Style();
		 System.out.println("good study");
	}
	Person ps = new Person();
	
}
class St_A extends Student
{
	void test()
	{
		ps.eat();
	}
}

class Worker extends Person
{
	public void work()
	{
		super.Style();
		System.out.println("good work");		 
	}
	
	public  void eat()
	 {
		 System.out.println("I am Worker,I like eat fresh meat");
	 }
}

public class ExtendsDemo2{
	public  static void main(String[] args)
	{
			Worker wk = new Worker();
			wk.work();
			
			Student st = new Student();
			st.study();
			
			St_A sa = new St_A();
			sa.test();
	}

}